<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<link href="/admins/css/yundan.css" rel="stylesheet" type="text/css" />
<link href="/admins/css/adminshare.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/admins/js/My97DatePicker/WdatePicker.js"></script>
<div class="admin_nrtop">
   <div class="ad_search">
   <form action="/admini/manageuser/transfer"  method="get" style="margin:0px" id="form1">
        <div class="search">
                <div class="soubox">
                <input type="text" id="quick" name="quick" value="<?php echo $this->quick?$this->quick:''; ?>" placeholder="输入物品号/仓库号/用户名等"/>
                <input type="hidden" id="timescope" name="timescope" value="<?php echo $this->timescope?$this->timescope:'';?>" />
                <input type="hidden" id="starttime" name="starttime" value="<?php echo $this->starttime?$this->starttime:'';?>"/>
                <input type="hidden" id="endtime" name="endtime" value="<?php echo $this->endtime?$this->endtime:'';?>" />
                <input type="hidden" id="pagesize" name="pagesize" value="<?php echo $this->pagesize?$this->pagesize:10;?>" />
                <input type="hidden" id="isDelete" name="isDelete" value="<?php echo $this->isDelete;?>" />
                <input type="hidden" id="status" name="status" value="<?php echo $this->status;?>" />
                <a href="javascript:$('#form1').submit();"><span>搜索</span></a>
            </div>            
        </div>

        <div class="timebox">
            <div class="ad_time">
                <div class="timezdy">
                    <div class="timeselect2">
                        <span>范围选择                        </span><i></i>
                    </div>
                    <div class="timeslelct_xl" style="display:none;">
                        <ul>
                            <li><a href="javascript:setstart('yesterday')">昨天</a></li>
                            <li><a href="javascript:setstart('day3')">近3天</a></li>
                            <li><a href="javascript:setstart('week')">本周</a></li>
                            <li><a href="javascript:setstart('lastweek')">上周</a></li>
                            <li><a href="javascript:setstart('month')">本月</a></li>
                            <li><a href="javascript:setstart('lastmonth')">上月</a></li>
                            <li><a href="javascript:setstart('quarter')">本季</a></li>
                            <li><a href="javascript:setstart('lastquarter')">上季</a></li>
                            <li><a href="javascript:setstart('year')">今年</a></li>
                            <li><a href="javascript:setstart('lastyear')">去年</a></li>
                            <li><a href="javascript:setstart('day7')">近7天</a></li>
                            <li><a href="javascript:setstart('day30')">近30天</a></li>
                        </ul>
                    </div>
                </div>
                <div class="timefw">
                    <div class="time">
                        <!--点击后悬停样式为：<div class="timeselect t_on">-->
                        <div class="timeselect"  id="stime">
                            <span id="stimeval"><?php echo $this->starttime?$this->starttime:date("Y年m月d日",mktime(0,0,0,date("m"),date("d")-90,date("Y")));?></span><i></i>
                        </div>
                        <div class="timeslelctbox">
                            <!---时间插件放此DIV-->
                        </div>
                    </div>
                    <div class="timezhi">
                        <span>至</span>
                    </div>
                    <div class="time" >
                        <div class="timeselect" id="etime">
                            <span id="etimeval"><?php echo $this->endtime?$this->endtime:date("Y年m月d日");?></span><i></i>
                        </div>
                        <div class="timeslelctbox">
                            <!---时间插件放此DIV-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="timeok">
                <a href="javascript:$('#form1').submit();">确定</a>
            </div>
        </div>
    <div class="xianshi">
            <label>显示：</label>  
        <ul>
            <li <?php echo $this->pagesize?($this->pagesize==10?'class="xson"':""):'class="xson"'; ?>><a href="javascript:setpagesize(10)">10</a></li>
            <li <?php echo $this->pagesize?($this->pagesize==20?'class="xson"':""):""; ?>><a href="javascript:setpagesize(20)">20</a></li>
            <li <?php echo $this->pagesize?($this->pagesize==30?'class="xson"':""):""; ?>><a href="javascript:setpagesize(30)">30</a></li>
        </ul>
    </div>
   </form>
    </div>
</div>
<div class="biaoge">
        <div class="biaotbody">
        <table>
                <tr>
                <th class="li205">
                        <div class="lijz">id</div>
                </th>
                <th class="li9">
                        <div class="lileft">创建时间</div>
                </th>
                <th class="li10">
                        <div class="lileft">汇款方银行账号</div>
                </th>
                <th class="li10">
                        <div class="lileft">交易流水号/监控号</div>
                </th>
                <th class="li6">
                        <div class="lileft">收款银行/国家</div>
                </th>
                <th class="li8">
                        <div class="lileft">汇款方姓名</div>
                </th>
                <th class="li6">
                    <div class="lileft">仓库号</div>
                </th>         
                <th class="li8">
                    <div class="lileft">用户名</div>
                </th>
                <th class="li10">
                    <div class="lileft">汇款金额</div>
                </th> 
                <th class="li6">
                    <div class="lileft">汇款时间</div>
                </th>
                <th class="li4">
                <div class="liright">处理&nbsp;　</div>
                </th>
                <th class="li6">
                    <div class="liright">操作 &nbsp;</div>
                </th>
            </tr>
        </table>
    </div>
   

    <div class="table">
        <table>       
           <?php foreach($this->list as $item){ ?>
              <tr>
                <td class="li205"><div class="lijz"><?php echo $item->Id; ?></div></td>
                <td class="li9">
                        　<span><?php echo $item->DateCreated; ?></span>                       
                </td>
                <td class="li10">
                    <div class="lileft">
                        <h2>
                            <a href="javascript:tanchuang(<?php echo $item->Id; ?>);" style="color:#6F0D24;"><?php echo $item->BankCard; ?></a>
                        </h2>
                    </div>
                </td>
                <td class="li10">
                    <div class="lileft"><p><?php echo $item->DealNo; ?></p></div>
                </td>
                <td class="li6">
                    <div class="lileft">
                        <p><?php echo $item->Bank; ?></p>
                    </div>
                </td>
                <td class="li8">
                     <div class="lileft">
                        <p><?php echo $item->RealName; ?></p>
                      </div>
                </td>
                <td class="li6">
                    <div class="lileft">
                        <p><a href="/admini/managestore/index/quick/<?=$item->userinfo->Storeno?>"><?=$item->userinfo->Storeno?></a></p>
                    </div>
                </td>
                 <td class="li8">
                     <div class="lileft">
                        <p><a href="/admini/manageuser/userdetail/id/<?=$item->userinfo->id?>"><?=$item->userinfo->Nikename?></a></p>
                      </div>
                </td>
                <td class="li10">
                    <div class="lileft">
                        <span><?php echo $item->Money." ".$item->UnitName; ?></span>
                    </div>
                </td>
                <td class="li6">
                        <div class="lileft">
                            <span><?php echo $item->TransferTime; ?></span>
                        </div>
                </td>
                <td class="li4">
                        <div class="liright">
                            <?php if($item->IsDelete == 1){ ?><p>　&nbsp;<font color="red">已删除　</font></p><?php }else{ ?>
                                <?php if($item->Status == 1){ ?><p>　&nbsp;<font>已处理　</font></p><?php }else{ ?>
                                <a href="javascript:processed(<?php echo $item->Id; ?>);"><button style="width:54px;height:32px;">已处理</button></a>
                            <?php }} ?>
                        </div>
                </td>
                <td class="li6">
                        <div class="lixlnav">                            
                        <a class="xlnavxq" href="javascript:tanchuang(<?php echo $item->Id; ?>);">详情</a>
                        <div class="xlnavlistbox">
                                <a class="xlnavsj" href="#"><i></i></a>
                            <div class="xlnavlist" style="display:none;">
                                <ul>
                                        <li><a href="javascript:del(<?php echo $item->Id; ?>);">删除</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
          <?php } ?>   
       </table>
    </div>
</div>

<div class="tanchuang" style="display:none;">
    <div class="nui-msgbox">
        <div class="nui-msgbox-hd" id="wayProblem">汇款凭证</div>
        <a class="nui-msgbox-close" title="关闭" href="javascript:close();"><b></b></a>
    </div>
    <div id="transferdetail" style="width:100%;height:100%;">
    </div>
</div>
<div class="houtai_overlay" style="display:none;"></div>

<div class="toolbar" >
<div class="toolbar" <?php if (empty($this->list)) echo "style='display: none'"; ?>>
        <?php echo $this->partial('paging.phtml', array("pages" => $this->res,"pamas"=>"quick=$this->quick&pagesize=$this->pagesize&starttime=$this->starttime&endtime=$this->endtimes&isDelete=$this->isDelete&status=$this->status")); ?>
</div>
<input type="hidden" name="start" value="" id="start"></div> 

<script type="text/javascript">
    $(".xlnavsj").live("mousemove",function(){
        $(this).next("div").attr("style","display:block;");
    });
    $(".lixlnav").mouseleave(function(){
        $(".xlnavsj").next("div").attr("style","display:none;");
    });
    
    function setpagesize(size)
    {
        $(".xianshi ul li").attr("class","");
        $(".soubox #pagesize").val(size);
        $('#form1').submit();
    }
    
    if($("#quick").val() != ""){
        $(".soubox label").attr("style","display:none;");
    }
    $('.soubox label').click(function(){
            $(this).parent().find('input').focus();
    });
    $('#quick').keyup(function(){
        if($(this).val()=='')
            $(this).next().show();
        else
            $(this).next().hide();
    }); 
    $(".timezdy").click(function(){
        $(".timezdy .timeselect2").attr("class","timeselect2 timeon");
        $(".timeslelct_xl").attr("style","display:block;");
    });
    $(".timezdy").mouseleave(function(){
       $(".timeselect2").attr("class","timeselect2");
       $(".timeslelct_xl").attr("style","display:none;");
    });
    $("#stime").click(function(){
        $(this).attr("class","timeselect t_on");
        WdatePicker({el:'stimeval',dateFmt:'yyyy年M月d日',vel:'starttime',onpicked:function(){
                $("#stime,#etime").attr("class","timeselect");
                $(".soubox #timescope").val("");
        }});
    });
    
    $("#etime").click(function(){
        $(this).attr("class","timeselect t_on");
        WdatePicker({el:'etimeval',dateFmt:'yyyy年M月d日',vel:'endtime',onpicked:function(){
                $("#stime,#etime").attr("class","timeselect");
                $(".soubox #timescope").val("");
        }});
        
    });
    
    function setstart(start){
        $(".soubox #timescope").val(start);
        $(".timeselect2").attr("class","timeselect2");
        $(".timeslelct_xl").attr("style","display:none;");
        $('#form1').submit();
    }
    function del(id){
        if(confirm("确定要删除id为"+id+"的汇款记录！")){
            $.post(
                '/admini/manageuser/deltransfer',
                {'id':id},
                function (data){
                    if(data === 1){
                        alert("删除成功！");
                        location.reload();
                    }else{
                        alert("删除失败！");
                        location.reload();
                    }
                }
            );       
        }
    }
    
    function tanchuang(id){
        $('.tanchuang').show();
        $('.houtai_overlay').show();
        $.post(
             '/admini/manageuser/transferdetail',
             {'id':id},
             function (data){
                 $('#transferdetail').html("<img src='<?= $this->cdn ?>/"+data.picture+"'width='600px;' height='475px;'/>");
             }
        );
    }
    
    function close(){
        $('.tanchuang').hide();
        $('.houtai_overlay').hide();
    }
    
    function processed(id){
        if(confirm("确定已经为id为"+id+"的线下汇款充值了吗？")){
            $.post(
                '/admini/manageuser/processedtransfer',
                {'id':id},
                function (data){
                    if(data === 1){
                        alert("处理成功！");
                        location.reload();
                    }else{
                        alert("处理失败！");
                        location.reload();
                    }
                }
            );       
        }
    }
    
    
    
</script>
